package com.fili.gui.dialogs;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Oct 14, 2006
 * Time: 11:37:36 PM
 */
public class RegisterMessageDialog extends JDialog implements ActionListener
{
    private JButton btnStart;
    private JButton btnQuit;
    private JButton btnRegister;

    public RegisterMessageDialog(String message, boolean canRun)
    {
        super((Frame) null, "Va rugam inregistrati", true);

        setLayout(null);
        String[] lines = message.split("\\n");
        int y = 10;
        for (String line : lines)
        {
            JLabel lbl = new JLabel(line);
            lbl.setBounds(10, y, 180, 15);
            add(lbl);
            y += 15;
        }

        y+=15;

        btnStart = new JButton("Start");
        btnStart.setBounds(10, y, 60, 25);
        btnStart.addActionListener(this);
        add(btnStart);

        btnQuit = new JButton("Quit");
        btnQuit.setBounds(75, y, 60, 25);
        btnQuit.addActionListener(this);
        add(btnQuit);

        btnRegister = new JButton("Register...");
        btnRegister.setBounds(190, y, 90, 25);
        btnRegister.setFont(btnRegister.getFont().deriveFont(Font.BOLD));
        btnRegister.addActionListener(this);
        add(btnRegister);

        y+=30;
        setSize(300,y+38);

        setVisible(true);
    }

    public void actionPerformed(ActionEvent e)
    {
        //To change body of implemented methods use File | Settings | File Templates.
    }
}
